Contacts and Location Messages
Before You Start
You need to meet all the prerequisites listed in the Before You Start section of the documentation.
Step 1: Make POST Request
Payload: Contacts Messages
{
"recipient_type": "individual",
"to": "918892532751",
"type": "contacts",
"contacts": [
{
"addresses": [
{
"city": "Menlo Park",
"country": "United States",
"country_code": "us",
"state": "CA",
"street": "1 Hacker Way",
"type": "HOME",
"zip": "94025"
},
{
"city": "Menlo Park",
"country": "United States",
"country_code": "us",
"state": "CA",
"street": "200 Jefferson Dr",
"type": "WORK",
"zip": "94025"
}
],
"phones": [
{
"phone": "+1 (940) 555-1234",
"type": "HOME"
},
{
"phone": "+1 (650) 555-1234",
"type": "WORK",
"wa_id": "16505551234"
}
],
"urls": [
{
"url": "https://www.facebook.com",
"type": "WORK"
}
],
"emails": [
{
"email": "test@fb.com",
"type": "WORK"
},
{
"email": "test@whatsapp.com",
"type": "WORK"
}
],
"birthday": "",
"org": {
"company": "WhatsApp",
"department": "Design",
"title": "Manager"
},
"name": {
"first_name": "John",
"formatted_name": "dkdj",
"last_name": "Smith"
}
}
],
"metadata": {
"channel": "wa"
}
}
For more information on parameters, see:
Payload: Location Messages
{
"recipient_type": "individual",
"to": "xxxxx",
"type": "location",
"location": {
"longitude": "81.899",
"latitude": "25.709",
"name": "Bangalore",
"address": "This is present in Karnataka, India"
},
"metadata": {
"channel": "wa"
}
}
For more information on parameters, see:
Step 2: Check Your Response
The response example shows a sample response from the API request: Possible elements in responses includes,
- Success Response
Payload
{
"success": true,
"responseId": "1606887827245734233232332"
}
- An unsuccessful response contains an error message. See Error and Status Codes for more information.